Skip to content

API: Define RewrapEncryptionKeys action interface - #18440

Open
dramaticlly wants to merge 2 commits into
apache:mainfrom
dramaticlly:api-rewrap-encryption-keys
Open

dramaticlly wants to merge 2 commits into
apache:mainfrom
dramaticlly:api-rewrap-encryption-keys

Conversation

@dramaticlly

@dramaticlly dramaticlly commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

First step of #18240 to define action interface to allow rewrap of encrypted iceberg table.

Added configurable depth level to control how deep the encryption key of iceberg metadata shall be regenerated.

  • KEK: where key-encryption-key is regenerated and stored in table metadata, manifest-list key is unwrapped with old KEK and rewrapped with new KEK. This can be done in table API with only change to metadata.json
  • manifest key: where key-encryption-key, manifest-list key as well as manifest keys are all regenerated, every data and delete live entry in manifests are rewrapped. All metadata layer keys are replaced. Requires engine to distribute the work and expect a new set of manifests, a new snapshot and new metadata.json

Thought about the option to introduce rewrapKeys flag on the existing RewriteManifests action and procedure and it was discarded to avoid combining security operation inside a re-clustering/optimizing call, also rewrite manifests can only focused on single partition spec.

Re-wrapping every key in a table means rewriting every manifest, which
is cost prohibitive for large iceberg tables. The level
names the lowest key to regenerate: the keys above it are regenerated
too, the keys directly below it are re-wrapped under the new ones, and
the keys further below are left unchanged.

Generated-by: Claude Code
@dramaticlly

Copy link
Copy Markdown
Contributor Author

@ggershinsky do you think if it's ok to start with KEY_ENCRYPTION_KEY and MANIFEST_KEY depth level? We can always add data file key later in the enum if there's need for the expensive key replacement.

@ggershinsky

Copy link
Copy Markdown
Contributor

sure, makes sense

@ggershinsky

ggershinsky commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

there should also be a MANIFEST_LIST_KEY level, between these two?
KeyRegenerationLevel : KEY_ENCRYPTION_KEY, MANIFEST_LIST_KEY, MANIFEST_KEY, DATA_KEY
(ROOT_MANIFEST for v4?)

@ggershinsky

Copy link
Copy Markdown
Contributor

Thinking of this, we might want to refocus / rename the action, from rewrap to rotate, for the following reasons:

  • KeyRegeneration is basically key rotation
  • "key rotation" is more intuitive and better known than "key rewrapping"
  • data file reencryption does not map well to a key rewrapping hierarchy

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants